var alarmId = '';
mui.init();


mui.plusReady(function() {
	self = plus.webview.currentWebview();
//	alert(self.info.alarmId);
	
	alarmId = self.info.alarmId;

	getDetail(alarmId)
})

function getDetail(alarmId) {
	document.getElementById('alarmDetailWrap').innerHTML = '';
	/*request("/app/alarm/detail/1", "GET", function(res) {
		render('#alarmDetailWrap', 'alarmDetail', res.data, true)
	}, true, function() {
		var arr = document.getElementsByClassName("nodata");
		for (var i = 0; i < arr.length; i++) {
			arr[i].innerText = "暂无数据";
		}
	});*/
	
	request("/app/alarm/detail/"+alarmId, "GET",{}, function(res) {
		render('#alarmDetailWrap', 'alarmDetail', res.result, true);
		var imhUrl = res.result.svgFile;
		document.getElementById('openImg').addEventListener('tap',function() {
			var btnText = this.innerText;
			if (btnText === '打开') {
				this.innerText = '关闭';
				document.getElementById('imgWrap').style.display = 'block';
			}else {
				this.innerText = '打开';
				document.getElementById('imgWrap').style.display = 'none';
			}
		})
	}, false, function() {
		
	});
}
